<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="pg" tagdir="/WEB-INF/tags" %>  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>意见箱列表</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.tabfont01 {	
	font-family: "宋体";
	font-size: 9px;
	color: #555555;
	text-decoration: none;
	text-align: center;
}
.font051 {font-family: "宋体";
	font-size: 12px;
	color: #333333;
	text-decoration: none;
	line-height: 20px;
}
.font201 {font-family: "宋体";
	font-size: 12px;
	color: #FF0000;
	text-decoration: none;
}
.button {
	font-family: "宋体";
	font-size: 14px;
	height: 37px;
}
html { overflow-x: auto; overflow-y: auto; border:0;} 
-->
</style>

<link href="<c:url value="/styles/ad/css.css"/>" rel="stylesheet" type="text/css" />
<link href="<c:url value="/styles/ad/style.css"/>" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<c:url value="/scripts/jquery-1.4.4.min.js"/>"></script>
</head>
<SCRIPT language=JavaScript>
function sousuo(){
	window.open("gaojisousuo.htm","","depended=0,alwaysRaised=1,width=800,height=510,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0");
}
function selectAll(){
	var obj = document.fom.elements;
	for (var i=0;i<obj.length;i++){
		if (obj[i].name == "delid"){
			obj[i].checked = true;
		}
	}
}

function unselectAll(){
	var obj = document.fom.elements;
	for (var i=0;i<obj.length;i++){
		if (obj[i].name == "delid"){
			if (obj[i].checked==true) obj[i].checked = false;
			else obj[i].checked = true;
		}
	}
}


//激活所有选择的意见
function jhSelyj(){
	var ucodeList = "";
	$("input[name='delid']:checked").each(function(){
		ucodeList =ucodeList + $(this).attr("value")+"@";
	});
	if(ucodeList == ""){
		alert("请选择要激活的项");
		return -1;
	}
	ucodeList = ucodeList.substring(0,ucodeList.length-1);
	if(confirm("确定激活？"))
	   	 $.ajax({
	   		url : "jhYjList",
	   		type : "post",
	   		data:"lycodeList="+ucodeList,
	   		dataType:"json",
	   		success : function(data) {
	   			var bool = data.message;
	   			if(bool == "true"){
	   				window.location.reload(); 
	   			}else{
	   				alert("激活失败");
	   			}
	   		}
	   	});
}


//删除所有选择的意见
function delSelyj(){
	var ucodeList = "";
	$("input[name='delid']:checked").each(function(){
		ucodeList =ucodeList + $(this).attr("value")+"@";
	});
	if(ucodeList == ""){
		alert("请选择要禁用的项");
		return -1;
	}
	ucodeList = ucodeList.substring(0,ucodeList.length-1);
	if(confirm("确定删除？"))
	   	 $.ajax({
	   		url : "delYjList",
	   		type : "post",
	   		data:"lycodeList="+ucodeList,
	   		dataType:"json",
	   		success : function(data) {
	   			var bool = data.message;
	   			if(bool == "true"){
	   				window.location.reload(); 
	   			}else{
	   				alert("删除操作失败");
	   			}
	   		}
	   	});
}

//禁用所有选择的意见
function jySelyj(){
	var ucodeList = "";
	$("input[name='delid']:checked").each(function(){
		ucodeList =ucodeList + $(this).attr("value")+"@";
	});
	if(ucodeList == ""){
		alert("请选择要禁用的项");
		return -1;
	}
	ucodeList = ucodeList.substring(0,ucodeList.length-1);
	alert(ucodeList);
	if(confirm("确定禁用？"))
	   	 $.ajax({
	   		url : "jySelyj",
	   		type : "post",
	   		data:"lycodeList="+ucodeList,
	   		dataType:"json",
	   		success : function(data) {
	   			var bool = data.message;
	   			if(bool == "true"){
	   				window.location.reload(); 
	   			}else{
	   				alert("禁用操作失败");
	   			}
	   		}
	   	});
}

function on_load(){
	var loadingmsg=document.getElementById("loadingmsg");
	var mainpage=document.getElementById("mainpage");
	loadingmsg.style.display="";
	mainpage.style.display="none";
	
	loadingmsg.style.display="none";
	mainpage.style.display="";
}
</SCRIPT>

<body onload="on_load()">
<form name="fom" id="fom" method="post" action="">
<table id="mainpage" width="100%" border="0" cellspacing="0" cellpadding="0">

  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="62" background="<c:url value="/images/ad/nav04.gif"/>">
          
		   <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
		  <tr>
			<td width="21"><img src="<c:url value="/images/ad/ico07.gif"/>" width="20" height="18" /></td>
			<td width="550">查看内容：按时间：
              <input name="textfield" type="text" size="12" readonly="readonly"/><span class="newfont06">至</span>
			 <input name="textfield" type="text" size="12" readonly="readonly"/>	
			 <input name="Submit" type="button" class="right-button02" value="查 询" /></td>
			 <td width="132" align="left"><a href="#" onclick="sousuo()">
			   <input name="Submit" type="button" class="right-button07" value="高级搜索" /></a></td>	
		  </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table id="subtree1" style="DISPLAY: " width="100%" border="0" cellspacing="0" cellpadding="0">

        <tr>
          <td><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">

          	 <tr>
               <td height="20"><span class="newfont07">选择：<a href="#" class="right-font08" onclick="selectAll();">全选</a>-<a href="#" class="right-font08" onclick="unselectAll();">反选</a></span>
	              <input name="Submit" type="button" class="right-button08" value="删除所选意见" onclick="delSelyj()"/>
	              <input name="Submit" type="button" class="right-button08" value="禁用所选意见" onclick="jySelyj()"/>
	              <input name="Submit" type="button" class="right-button08" value="启用所选意见" onclick="jhSelyj()"/>
          	 </tr>
              <tr>
                <td height="40" class="font42"><table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#464646" class="newfont03">

					                  <tr>
                    <td height="20" colspan="13" align="center" bgcolor="#EEEEEE"class="tablestyle_title"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 用户信息列表 &nbsp;</td>
                    </tr>
                  <tr>
				    <td width="5%" align="center" bgcolor="#EEEEEE">选择</td>
                    <td width="10%" height="20" align="center" bgcolor="#EEEEEE">意见编号</td>
                    <td width="10%" align="center" bgcolor="#EEEEEE">提意见人姓名</td>
                    <td width="10%" align="center" bgcolor="#EEEEEE">生成时间</td>
                    <td width="5%" align="center" bgcolor="#EEEEEE">意见状态</td>
                    <td width="10%" align="center" bgcolor="#EEEEEE">操作</td>
                  </tr>
                  <c:forEach items="${yjs.getList()}" var="yj">
                  <tr align="center">
				   <td bgcolor="#FFFFFF"><input type="checkbox" name="delid" value="${yj.getStr('lycode')}"/></td>
                    <td height="20" bgcolor="#FFFFFF">${yj.getStr("lycode")}</td>
                    <td bgcolor="#FFFFFF"><a href="<c:url value="goToDetail?lycode=${yj.getStr('lycode')}"/>">${yj.getStr("lyname")}</a></td>
                    <td bgcolor="#FFFFFF">${yj.getStr("ctime")}</td>
                    <td bgcolor="#FFFFFF">${yj.getInt("lystate")==1?"可用":"禁用"}</td>
                    <td bgcolor="#FFFFFF"><a href="<c:url value="goToDetail?lycode=${yj.getStr('lycode')}"/>">查看</a></td>
                  </tr>
                  </c:forEach>
                <tr bgcolor="#EEEEEE">
				<td align="center" colspan="15"	style=" line-height: 40px">
						<pg:paging
							currentPage="${yjs.getPageNumber()}"
							baseUrl="?keyword=${keyword}&start-time=${start}&end-time=${end}&reco-state=${state}&dlcode=${dlcode}&" total="${yjs.getTotalRow()}" 
							pageSize="55"></pg:paging></td>
				</tr>
                </table>
                </td>
              </tr>
            </table></td>
        </tr>
      </table>
      </td>
  </tr>
</table>
</form>

<div id="loadingmsg" style="width:100px; height:18px; top:0px; display:none;">
	<img src="file:///F|/项目管理相关资料/项目管理系统页面/images/loadon.gif" />
</div>

</body>
</html>